# Project:	MapReduce
# Author:	gong_libin
# Date:		2016_06_01

CC = g++
CFLAGS = -g -Wall

MR_ENV = $(shell pwd)
MR_BIN = $(MR_ENV)/bin
MR_INC = $(MR_ENV)/inc
MR_SRC = $(MR_ENV)/src
MR_UTL = $(MR_SRC)/MrUtils
MR_ACC = $(MR_SRC)/MrAccept
MR_PRO = $(MR_SRC)/MrProcess

MR_GLIB = /usr/lib
MR_GINC = /usr/include/MrInc

export CC
export CFLAGS

export MR_ENV
export MR_BIN
export MR_INC
export MR_SRC
export MR_UTL
export MR_ACC
export MR_PRO

export MR_GLIB
export MR_GINC

.PHONY: bin src test

all: bin src test

bin:
	if test -d $(MR_BIN); then true; else mkdir $(MR_BIN); fi;

src:
	$(MAKE) -C $(MR_UTL)
	$(MAKE) -C $(MR_ACC)
	$(MAKE) -C $(MR_PRO)

test:
	$(MAKE) -C test

clean:
	$(MAKE) clean -C $(MR_UTL)
	$(MAKE) clean -C $(MR_ACC)
	$(MAKE) clean -C $(MR_PRO)
	$(MAKE) clean -C test
	rm -rf $(MR_BIN)
